<?php
if (checkdate(2,29,2007)) {
    print( '日期合法');
} else {
    print( '日期不合法');
}
print("\n");
print( date('Y-m-d H:i:sa'));
print("\n");
print( date('今天的日期和时间为：Y/m/d H:i:sa'));  //可以插入无关的字符串
print("\n");
print_r(gettimeofday()); //可以传入一个真(1)
print("\n");
print_r(gettimeofday(1)); //可以传入一个真(1)
print("\n");
print_r(gettimeofday(2)); //可以传入一个真(1)

print_r(getdate(1184557366));
print_r(getdate());


print("\n");
print( date('Y-m-d H:i:s',time()+(7*24*60*60)));

print("\n");

print( mktime(14,14,14,11,11,2007));
$now=time();
print("\n");

echo gettype($now);
print("\n");
print($now);
print("\n");

print( strtotime('2007-10-31 14:31:33'));

print("\n");
print( date('Y-m-d H:i:s',getlastmod()));

print("\n");
putenv('TZ=Asia/Shanghai');

print( date('Y-m-d H:i:s'));
print("\n");

 
print("\n");
date_default_timezone_set('Asia/Shanghai');
print( date('Y-m-d H:i:s'));



print("\n");
print_r(localtime());
print("\n");
print_r(localtime(time(), true));


list($msec, $sec) = explode(' ', microtime());
print("\n");

print($msec."\n".$sec);
/**
 * 
 * Array
(
    [sec] => 1727717129
    [usec] => 893902
    [minuteswest] => -480
    [dsttime] => 0
)

1727717129.8939
1727717129.8939Array
(
    [seconds] => 46
    [minutes] => 42
    [hours] => 11
    [mday] => 16
    [wday] => 1
    [mon] => 7
    [year] => 2007
    [yday] => 196
    [weekday] => Monday
    [month] => July
    [0] => 1184557366
)
Array
(
    [seconds] => 29
    [minutes] => 25
    [hours] => 1
    [mday] => 1
    [wday] => 2
    [mon] => 10
    [year] => 2024
    [yday] => 274
    [weekday] => Tuesday
    [month] => October
    [0] => 1727717129
)
*/
